import pytest
import sys
import os
import tkinter as tk

def main():
    """运行测试"""
    # 添加项目根目录到Python路径
    project_root = os.path.dirname(os.path.abspath(__file__))
    sys.path.insert(0, project_root)
    
    # 运行pytest
    pytest_args = [
        "tests/",
        "-vs",
        "--html=reports/html_reports/report.html",
        "--self-contained-html",
        "--capture=no"
    ]
    
    exit_code = pytest.main(pytest_args)
    sys.exit(exit_code)

if __name__ == "__main__":
    main()